'''
二叉树
    二叉树的链式存储:将二叉树的结点定义为一个对象,结点之间通过类似链表的连接方式来连接
    结点定义:
    class BiTreeNode:
        def __init__(self,data):
            self.data = data
            self.lchild = None
            self.rchild = None
'''

class BiTreeNode:
    def __init__(self,data):
        self.data = data
        self.lchild = None  # 左孩子
        self.rchild = None  # 右孩子

a = BiTreeNode('A')
b = BiTreeNode('B')
c = BiTreeNode('C')
d = BiTreeNode('D')
e = BiTreeNode('E')
f = BiTreeNode('F')
g = BiTreeNode('G')

e.lchild = a
e.rchild = g
a.rchild = c
c.lchild = b
c.rchild = d
g.rchild = f

root = e

print(root.lchild.rchild.data)